﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.Modeling.Common;
using Microsoft.Practices.Modeling.Common.Design;
using Microsoft.Practices.Modeling.Common.Security;
using Microsoft.Practices.Modeling.Common.Utility;
using Microsoft.Practices.Modeling.ExtensionProvider.Utility;
using Microsoft.Practices.Services.ItineraryDsl;
using Microsoft.VisualStudio.Modeling;
using Microsoft.XLANGs.BaseTypes;
using System.CodeDom;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Xml.Serialization;
using Microsoft.Practices.Modeling.Services.Design;

namespace BizTalk.ESB.Extensions.Helpers
{
    public sealed class ItineraryServiceDataMappingEditor : CollectionEditor
    {
        public ItineraryServiceDataMappingEditor(Type type)
            : base(type)
        {
        }

        protected override bool CanSelectMultipleInstances()
        {
            return false;
        }
        protected override Type CreateCollectionItemType()
        {
            return typeof(BaseSourceMapping);
        }
    }

    [Serializable]
    public class BaseSourceMapping
    {
        public string DestiantionPropertySchemaNamespace { get; set; }
        public string DestiantionPropertyName { get; set; }
        public string DestinationPropertyValue { get; set; }
    }

    public class ContextSourceMapping : BaseSourceMapping
    {
        public string PropertySchemaNamespace { get; set; }
        public string PropertyName { get; set; }
    }

    public class ContentSourceMapping : BaseSourceMapping
    {
        public string Xpath { get; set; }
    }

    public class StaticSourceMapping : BaseSourceMapping
    {
        public string ConstantValue { get; set; }
    }
    public class GeneratedSourceMapping : BaseSourceMapping
    {
        public GeneratedDataMappingSources SourceType { get; set; }
    }
}
